program spiski;

{$APPTYPE CONSOLE}

uses
  SysUtils;

type
  pelement = ^element;
  element = record
    next: pelement;
    value: integer;
  end;

var
  i, n, t: integer;
  head: pelement;
  fin, fout: textFile;
procedure AddToBegin (head: pelement; num: integer);
var
  current: pelement;
begin
  current:=head;
  if(current<>nil) then
  begin
    while (current^.next<>nil) do
    begin
      current:=current^.next;
    end;
    new(current^.next);
    current^.next^.value:=num;
  end else
  begin
    new(current);
    head:=current;
    current^.value:=num;
  end;
end;
procedure AddToEnd (head: pelement);
var
  tmp: pelement;
begin
  tmp:=head;
  dispose(head);
  head:=tmp;
end;
procedure exchange(head: pelement) ;
var
  current, t: pelement;
  middle, tmp: integer;
begin
  if (n mod 2=0) then
  begin
    for i:=1 to n div 2 do
    begin
      tmp:=head^.value;
      addtoend(head);
      addtobegin(head,tmp);
    end;
  end else
  begin
    for i:=1 to n-1 div 2 do
    begin
      tmp:=head^.value;
      addtoend(head);
      addtobegin(head,tmp);
    end;
    middle:=head^.value;
    addtoend(head);
    current:=head;
    for i:=1 to n div 2 do
    begin
      current:=current^.next;
    end;
    t:=current;
    new(current);
    current^.value:=middle;
    current^.next:=t;
  end;
end;
procedure PrintList(head: pelement);
var
  current: pelement;
begin
  current:=head;
  while (current<>nil) do
  begin
    writeln(fout,current^.value);
    current:=current^.next;
  end;
end;
begin
  assignFile(fin,'input.txt');
  assignFile(fout,'output.txt');
  head:=nil;
  reset(fin);
  readln(fin, n);
  for i:=1 to n-1 do
  begin
    read(fin, t);
    AddToBegin(head,t);
  end;
  readln(fin);
  closeFile(fin);
  rewrite(fout);
  exchange(head);
  printlist(head);
  readln;
end.